Sams Teach Yourself Android Game Programming in 24 Hours by Jonathan S. Harbour

Sams Teach Yourself Android Game Programming in 24 Hours by Jonathan S. Harbour

Author:Jonathan S. Harbour
Language: eng
Format: epub
Publisher: Sams Publishing
Published: 2013-04-28T16:00:00+00:00


Adding Sound Files to the Project

The resource parameter should be the identifier for a resource found in the project’s .\res\raw folder. By default, .\res is part of a standard Android project, but the \raw subfolder is not created automatically. Thus, you have to add this folder to the project yourself manually. Figure 14.1 shows the .\res\raw folder in the Audio Demo project (covered later this hour).

Figure 14.1. Audio files are added to the .\res\raw folder of a project. Note that different audio file formats may be used interchangeably.

For instance, this resource identifier represents a file called Music in the .\res\raw folder (excluding the extension).

MediaPlayer mp = MediaPlayer.create(this, R.raw.music);



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.